'''
Created on Mar 21, 2016

@author: JimmyMo
'''
from queue import Queue
from pcframework import producer
from pcframework import consumer

class PCControllder(object):
    def __init__(self, producer_num=1, consumer_num=1):
        self.producer_num = producer_num
        self.consumer_num = consumer_num
        self.q = Queue()
        self.consumer_list = []
        pass
    def start(self):
        # initialize producers
        for i in range(self.producer_num):
            p = producer.Producer("producer_%d" % i, self.q)
            self.producer_list.append(p)
        # initialize consumers
        for i in range(self.consumer_num):
            c = consumer.Consumer("consumer_%d" % i, self.q)
            self.consumer_list.append(c)
#             self.consumer_list.append(object)
        
        pass
    